{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import matplotlib\n",
    "import numpy as np\n",
    "import seaborn as sns\n",
    "import string\n",
    "#https://stackoverflow.com/questions/19726663/how-to-save-the-pandas-dataframe-series-data-as-a-figure\n",
    "import six\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "tbpath = \"../../fits/\"\n",
    "productpath = \"../../postfit_derivatives/\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "models = [\"fulllinearmodel_fit_table.csv\",\"reducedlinearmodelNegBinom_fit_table.csv\",\n",
    "          \"reducedlinearmodelq0_fit_table.csv\",\"reducedlinearmodelq0ctime_fit_table.csv\",\n",
    "         \"nonlinearmodelq0ctime_fit_table.csv\",\"nonlinearmodel_fit_table.csv\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "rois = []\n",
    "for model in models:\n",
    "    df = pd.read_csv(tbpath + model) #get rois in all tables (some may have failed)\n",
    "    rois += list(df.roi.unique())\n",
    "\n",
    "    \n",
    "rois = list(set(rois))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "theta_ = [\"q\"]#,\"Rlast\"] #need to update Rlast\n",
    "\n",
    "\n",
    "dfreport = pd.DataFrame(columns=['Region', 'Model','median '+theta_[0],'CI lower','CI upper'])#,'median '+theta_[1],'CI lower','CI upper'])\n",
    "k = -1\n",
    "for roi in rois:\n",
    "    try:\n",
    "        k += 1\n",
    "        model = \"fulllinearmodel_fit_table.csv\" \n",
    "        df = pd.read_csv(tbpath + model)\n",
    "        theta = theta_[0]\n",
    "        measure1 = df.loc[(df.roi==roi)&(df['quantile']==0.5),theta].values[0]\n",
    "        measure2 = df.loc[(df.roi==roi)&(df['quantile']==0.025),theta].values[0]\n",
    "        measure3 = df.loc[(df.roi==roi)&(df['quantile']==0.975),theta].values[0]\n",
    "        x = [roi,model.split('_fit_table.csv')[0],np.round(measure1,4),np.round(measure2,4),np.round(measure3,4)]\n",
    "    #         theta = theta_[1]\n",
    "    #         measure1 = df.loc[(df.roi==roi)&(df['quantile']==0.5),theta].values[0]\n",
    "    #         measure2 = df.loc[(df.roi==roi)&(df['quantile']==0.025),theta].values[0]\n",
    "    #         measure3 = df.loc[(df.roi==roi)&(df['quantile']==0.975),theta].values[0]\n",
    "    #         x += [np.round(measure1,4),np.round(measure2,4),np.round(measure3,4)]\n",
    "        dfreport.loc[k] = x\n",
    "    except:\n",
    "        print(roi)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.14055\n",
      "0.013283978885206965\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcwAAAEyCAYAAAB3Q+DvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3de3hU1b3/8c9KQhIIoCEBAoVwCRQKrSBVwFZijNRQaxUV1IpShANCaYtctGIVgorGKiKKyo/TloD49AAichChgAEvFBEinJ4jwdKSSK0ebgEJEkMu+/fHnuRkkkmykkxmcnm/nmeekDV777W+M5v5ZF/HOI4jAABQvZBgDwAAgKaAwAQAwAKBCQCABQITAAALBCYAABYITAAALITV8DzXnAAIuqQk9+euXcEcBVoQ46uRLUwAACwQmAAAWCAwAQCwQGACAGCBwAQAwAKBCQCABQITAAALBCYAABZqunGBlYKCAuXm5iovL0/FxcX+WCTQqISGhqpdu3b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HbsWC1dulTTp0+3es327dune+65R8OHD9fBgwc1cuRIxcTEVDsvABCYdZCfn68DBw547Yb95ptvNGnSJA0bNkwZGRllux/vu+8+DRo0SLNmzdKuXbuUlJSkoqIizZo1Sx07dtRHH32k6OhoSdK0adN02WWXWY0hPT1du3fv1gMPPOC1lThy5EjdeOONmjt3rl599VWveY4dO6asrCxdcsklkqSJEyeqR48eevHFF2sMTElKTk7WypUrdeHCBbVp00YffvihLly4oLvvvlsbN25UUVGRwsLC9O6776q4uFjJycnVLu+3v/2tzpw5o4yMDF177bWSpOnTp+vWW2/VgQMHvKb9+OOPtXDhQs2dO1dPPvlkWfuvf/1rjR49WnPnztX48ePVrl27KvtbsWKF9u3bp3nz5pWFviQNGDBAM2fOVI8ePWp8DQC0XOySrYNp06ZVOma5fft2HT9+XPfee6/Onj2rU6dOlT1uuOEGSdK2bdskSZmZmfriiy80YcKEsrCUpLZt22rq1KlWY9iwYYNCQkI0d+5cr/af/OQnGjx4sDZu3KiSEu+Tru69996ysJSkNm3aaPjw4Tpy5IhVn8nJySosLNT7778vScrIyFCnTp00Y8YM5eXlad++fZKknTt3yhhTFoK+lJSUaNOmTbriiiu8pjPG6MEHH6w0/WuvvSZjjH7+8597vbanTp3STTfdpLy8PO3Zs6fa8b/55psKDQ3V7NmzvdqnTZum9u3bW70GAFoutjDr4Nvf/naltqysLEnuVltVjh8/LsndFSmpbFdueb7afMnOzlbXrl29ArfUwIEDdfDgQZ06dUqdOnUqa+/du3elaWNiYnT69Omy37/66ivl5+d7TdOxY0eFhoaWbTFmZGQoJSWlbMtwyJAhio6OVkZGhq666iplZGRo0KBB6tChQ5XjP3HihM6fP6/+/ftXem7AgAGV2rKysuQ4js/pS5W+vlU5evSounTpUikcIyIi1Lt3b505c6ba+QG0bARmHfg6I9ZxHEnSM888o8GDB/ucr2vXrg06rpqEhobWOM2MGTO0cuVKr7bs7Gz17NlTnTt31oABA5SRkaELFy5o7969evHFFxUSEqJrrrlG77zzjqZOnaq//vWv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qXlR/3eHiH+TtEjuQd1dKnehvaQcd8h1m98z7eVyP0hyJaXKvbD2A8/8C5pj3XL/EtvrmfY9uSv1/Z5/O5LWNqGa75F7otIjci+ROFPu93sqTPsDuSci/KNczf/wvP+Dmth7bVW33C2tU3JP8Z8v6W4fjwa5C0qw3+8q+t+lwN/pJ5DreLzcXbL5cq+p/oWktzz9r2zGdb/u6eu/JD0gabrcG1U4ci8lC22QGgP5glbzQofKPS36U7kfcP+Se1Zf2wrTVfVCW81fbvrLPC/uWbl/fR6QNKE51y33jLonJR32TPuN3F06D0oKa0I17/L8p/D12OVj+qvk3g7wvNzdk3+WNKQJvtdWdcs9yaOq6UofPZtb3dX0v0uBD8xAr+M95W7BnZR7FmqWp/8ab0fXVOuWe4vTB+UGZr6nv7/J/YxrsD8I+T5MAAAsNIZjmAAANHoEJgAAFghMAAAsEJgAAFggMAEAsEBgAgBggcAEAMACgQkAgAUCEwAACwQmAAAWCEwAACwQmEAjYYzpboxZa4z5yhhzzhizyfNVSDnGmF3BHh/Q0gXiS4MB1MAYc6ncr1vrLmmZ3O/8u0bSTkmtgzg0ACNTS8kAAAEPSURBVB5sYQKNw4Nyv6ZpsuM4v3Qc52XHce6Q+92CsUEdGQBJ4uu9gMbAGHNIUgdJ33Icp7hcexdJX0h613GcpCAND4DYwgQai96SjpQPS0lyHOdLuV90DiDICEwAACwQmEDjcFRSX2NMaPlGzy7ZS4MzJADlEZhA47BRUmdJ4yu0/yYIYwHgAyf9AI2AMSZa0kFJ35J7WcknkpIkXSX3spJPOOkHCC62MIFGwHGcM5JGSHpT7lbm05LaSLpW0tdBHBoAD25cADQSjuMckzSmYrsxJgijAVARW5gAAFggMAEAsEBgAgBggbNkAQCwwBYmAAAWCEwAACwQmAAAWCAwAQCwQGACAGCBwAQAwML/BwAmwsRH1cg1AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 576x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "font = {'family' : 'sans-serif',\n",
    "        'weight' : 'normal',\n",
    "        'size'   : 18}\n",
    "\n",
    "matplotlib.rc('font', **font)\n",
    "\n",
    "\n",
    "def simpleaxis(ax):\n",
    "    ax.spines['top'].set_visible(False)\n",
    "    ax.spines['bottom'].set_visible(False)\n",
    "    ax.spines['right'].set_visible(False)\n",
    "    ax.spines['left'].set_visible(False)\n",
    "\n",
    "\n",
    "f,ax = plt.subplots(1,1,figsize=(8,5))\n",
    "\n",
    "## R0\n",
    "sns.distplot(dfreport['median q'],color=sns.xkcd_rgb[\"bright blue\"],ax=ax, kde=False, norm_hist=True, label='region-wide q')\n",
    "mu = np.median(dfreport['median q'].values)\n",
    "print(mu)\n",
    "ax.axvline(mu,color='b',label='median q')\n",
    "# print(dfreport['median q'].quantile(q=[0.025,0.5,0.975]))\n",
    "print(dfreport['median q'].std())\n",
    "## Rlast\n",
    "# sns.distplot(dfreport['median R0'],color=c_[1],ax=ax, kde=False, norm_hist=True,label='region-wide April 15th, 2020')\n",
    "# mu = np.median(dfreport['median Rlast'].values)\n",
    "# print(mu)\n",
    "# ax.axvline(mu,color='b',alpha=0.5,label='median April 15th, 2020')\n",
    "# print(dfreport['median Rlast'].quantiles(q=[0.025,0.5,97.5]))\n",
    "\n",
    "\n",
    "plt.legend(loc=2)\n",
    "simpleaxis(ax)\n",
    "ax.get_yaxis().set_visible(False)\n",
    "ax.set_xlabel('')\n",
    "plt.subplots_adjust(hspace=0.5,bottom=0.1)\n",
    "ax.set_xlabel('q')\n",
    "plt.subplots_adjust(hspace=0.5,bottom=0.2)\n",
    "plt.savefig(productpath + 'q.png')\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
